package com.bac.rentmap.jdo;

import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

import org.springframework.beans.factory.annotation.Required;

/**
 * Helper class to work with datastore via JDO.
 *
 * @author Andrew Osipenko
 */
public abstract class JdoSupport {
    private PersistenceManagerFactory persistenceManagerFactory;

    protected PersistenceManager getPersistenceManager() {
        return persistenceManagerFactory.getPersistenceManager();
    }

    @Required
    public void setPersistenceManagerFactory(
            PersistenceManagerFactory persistenceManagerFactory) {
        this.persistenceManagerFactory = persistenceManagerFactory;
    }
}
